package net.lucamasini.ricette.client;

import net.lucamasini.ricette.client.ricette.*;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.place.shared.PlaceController;

public class ClientFactoryImpl implements ClientFactory {

	private final EventBus eventBus = new SimpleEventBus();
    private final PlaceController placeController = new PlaceController(eventBus);
    private final RicetteView ricetteView = new Ricette();
    private final RicetteDialogView ricetteDialogView = new RicetteDialog();
    private final RicettarioRequestFactory requestFactory = GWT.create(RicettarioRequestFactory.class);
    
	public ClientFactoryImpl() {
		requestFactory.initialize(eventBus);
	}

	@Override
	public EventBus getEventBus() {
		return eventBus;
	}

	@Override
	public PlaceController getPlaceController() {
		return placeController;
	}

	@Override
	public RicetteView getRicetteView() {
		return ricetteView;
	}

	@Override
	public RicettarioRequestFactory getRequestFactory() {
		return requestFactory;
	}

	@Override
	public RicetteDialogView getRicetteDialogView() {
		return ricetteDialogView;
	}

}
